package com.xwaiy.xwaiyrpc.config;

import com.xwaiy.xwaiyrpc.fault.retry.RetryStrategyKeys;
import com.xwaiy.xwaiyrpc.fault.tolerant.TolerantStrategyKeys;
import com.xwaiy.xwaiyrpc.loadbalancer.LoadBalancer;
import com.xwaiy.xwaiyrpc.loadbalancer.LoadBalancerKeys;
import com.xwaiy.xwaiyrpc.serializer.Serializer;
import com.xwaiy.xwaiyrpc.serializer.SerializerKeys;
import lombok.Data;

/**
 * 配置
 * @Author Xwaiy
 * @Date 2025/8/21 17:27
 **/
@Data
public class RpcConfig {
    /**
     * 名称
     */
    private String name = "xwaiy-rpc";

    /**
     * 版本号
     */
    private String version = "1.0";

    /**
     * 服务器主机名
     */
    private String serverHost = "localhost";

    /**
     * 服务器端口号
     */
    private Integer serverPort = 9000;

    /**
     * 模拟调用
     */
    private  boolean mock = false;

    /**
     * 序列化器
     */
    private String serializer = SerializerKeys.JDK;

    /**
     * 注册中心配置
     */
    private RegistryConfig registryConfig = new RegistryConfig();

    /**
     * 负载均衡器
     */
    private String loadBalancer = LoadBalancerKeys.ROUND_ROBIN;

    /**
     * 重试策略
     */
    private String retryStrategy = RetryStrategyKeys.NO;

    /**
     * 容错策略
     */
    private String tolerantStrategy = TolerantStrategyKeys.FAIL_FAST;
}
